//
//  CompanyDetailViewController.m
//  Btpin
//
//  Created by Vic on 2019/3/18.
//  Copyright © 2019 Vic. All rights reserved.
//



#import "CompanyDetailViewController.h"
#import "CompanyOfJobCell.h"
#import "CompanyDetailBaseInfoView.h"
#import "CompanyInfoModel.h"
#import "CompanyJobModel.h"
#import "JobDetailViewController.h"
#import "ShowImgView.h"
#import "ChatViewController.h"

@class TConversationCellData;

@interface CompanyDetailViewController ()<UITableViewDelegate, UITableViewDataSource, CompanyDetailBaseInfoViewDelegate, ShowImgViewDelegate>
{
    BaseNetManager *netManager;
    CompanyInfoModel *infoModel;
    
    NSMutableArray *itemDataArray;
    
    UIScrollView *bottomScrollView;
    CompanyDetailBaseInfoView *headerView;
    
//    UIBarButtonItem *collect;
//    UIBarButtonItem *chat;
    UIButton *attentionBtn;
    
    UIView *bottomBgView;
    NSInteger currentPage;
    
    BOOL moreInfoTapFlag;
    ShowImgView *showImgView;
}
@property (nonatomic, strong) UITableView *jobTableView;
@end

@implementation CompanyDetailViewController

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];;
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES animated:YES];
}
- (void)viewDidLoad {
    [super viewDidLoad];
//    self.navigationItem.title = @"公司详情";
    
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(lookImg:) name:NotificationFor_CertPic_LookImg object:nil];
    
    netManager = [BaseNetManager sharedManager];
    moreInfoTapFlag = NO;
    currentPage = 1;
    itemDataArray = [NSMutableArray arrayWithCapacity:0];
    
    [self loadData];
//    [self initUI];
}
- (void)lookImg:(NSNotification *)notification {
    showImgView.hidden = NO;
    [showImgView reloadDataForImg:notification.userInfo[@"url"]];
}
- (void)showImgViewCancel:(ShowImgView *)shareView {
    shareView.hidden = YES;
}
- (void)loadData {
    SVPHUDShow;
    NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithCapacity:0];
    dic = [UIToolsControl getPublicParameter];
    [dic setObject:self.id forKey:@"id"];
    
    [BaseNetManager requestWithMethod:POST path:CompanyDetail_URL params:dic successBlock:^(NSDictionary * _Nonnull responseObject) {
        if ([responseObject[@"code"] integerValue] == 2000) {
            id data = responseObject[@"data"];
            self->infoModel = [[CompanyInfoModel alloc] init];
            [self->infoModel setValuesForKeysWithDictionary:data];
            
            [self initUI];
            [self loadDataJobs];
        } else {
            [self.navigationController popViewControllerAnimated:YES];
            SVPHUDError(responseObject[@"msg"]);
        }
    } failurBlock:^(NSError * _Nonnull error) {
        [self loadData];
    }];
}
- (void)loadDataJobs {
    self.noDataView.hidden = YES;
    NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithCapacity:0];
    dic = [UIToolsControl getPublicParameter];
    [dic setObject:self.id forKey:@"company_id"];
    [dic setObject:[NSString stringWithFormat:@"%ld", (long)currentPage] forKey:@"page"];
    [dic setObject:PageSize forKey:@"number"];
    
    [BaseNetManager requestWithMethod:POST path:CompanyJobs_URL params:dic successBlock:^(NSDictionary * _Nonnull responseObject) {
        if ([responseObject[@"code"] integerValue] == 2000) {
            NSArray* data = responseObject[@"data"];
            if(data.count == 0){
                self->bottomBgView.hidden = YES;
                self->bottomScrollView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-SIMEmojKeyBoardkBottomNOSafeArea_Height);
            }else{
                self->bottomBgView.hidden = NO;
                self->bottomScrollView.frame = CGRectMake(0, 0, WIDTH, HEIGHT-SIMEmojKeyBoardkBottomNOSafeArea_Height-ScalePS(60));
            }
            for (NSDictionary *dic in data) {
                CompanyJobModel *model = [[CompanyJobModel alloc] init];
                [model setValuesForKeysWithDictionary:dic];
                [self->itemDataArray addObject:model];
            }
            [self.jobTableView reloadData];
            SVPHUDDismiss;
        } else {
            SVPHUDError(responseObject[@"msg"]);
        }
    } failurBlock:^(NSError * _Nonnull error) {
        SVPHUDError(NetErrorAlertText);
    }];
}
- (void)initUI {
    self.view.backgroundColor = THEMECOLOR_OF_WHITE;
    
//    collect = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:(([infoModel.focus_status integerValue])?@"collect_icon_s":@"collect_icon")] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(collectTap)];
//    chat = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"chat_icon"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(chatTap)];
//    self.navigationItem.rightBarButtonItems = @[chat, collect];
//    self.navigationItem.rightBarButtonItem = collect;
    
    bottomScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT-SIMEmojKeyBoardkBottomNOSafeArea_Height-ScalePS(60))];
    bottomScrollView.contentSize = CGSizeMake(0, HEIGHT-SIMEmojKeyBoardkBottomNOSafeArea_Height-ScalePS(60)+1);
    bottomScrollView.showsHorizontalScrollIndicator = NO;
    bottomScrollView.showsVerticalScrollIndicator = NO;
    [self.view addSubview:bottomScrollView];
    
    if (@available(iOS 11.0, *)) {
        bottomScrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    } else {
        self.automaticallyAdjustsScrollViewInsets = NO;
    }
    
    headerView = [[CompanyDetailBaseInfoView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, infoModel.partHeight) target:self info:infoModel];
    [bottomScrollView addSubview:headerView];
    bottomScrollView.contentSize = CGSizeMake(0, MAX(HEIGHT-SIMEmojKeyBoardkBottomNOSafeArea_Height-ScalePS(50)+1, moreInfoTapFlag?infoModel.allHeight:infoModel.partHeight));
    
    self.leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
        self.leftButton.frame = CGRectMake(0, HeightOfStatusBar, 44, 44);
//    self.leftButton.imageEdgeInsets = UIEdgeInsetsMake(11, 0, 12, 32);
    [self.leftButton setImage:[UIImage imageNamed:@"back_w"] forState:UIControlStateNormal];
    [self.leftButton addTarget:self action:@selector(customBackButtonTap) forControlEvents:UIControlEventTouchUpInside];
    [bottomScrollView addSubview:self.leftButton];
    
    attentionBtn = [UIToolsControl initButtonWithFrame:CGRectMake(WIDTH-60, HeightOfStatusBar, 60, 44) imageName:nil target:self action:@selector(collectTap) title:AttentionText titleColor:COLOR_OF_WHITE];
    attentionBtn.titleLabel.font = Font(16);
    [bottomScrollView addSubview:attentionBtn];
    
    bottomBgView = [UIToolsControl initViewWithFrame:CGRectMake(0, HEIGHT-SIMEmojKeyBoardkBottomNOSafeArea_Height-ScalePS(50), WIDTH, HEIGHT-SIMEmojKeyBoardkBottomNOSafeArea_Height-ScalePS(200)) backgroundColor:COLOR_OF_WHITE];
    bottomBgView.userInteractionEnabled = YES;
    [bottomBgView corners:(UIRectCornerTopLeft | UIRectCornerTopRight) radii:CGSizeMake(20, 20)];
    [self.view addSubview:bottomBgView];
    
    UILabel *bottomLbl = [UIToolsControl initLabelWithFrame:CGRectMake(ScalePS(25), ScalePS(10), WIDTH-ScalePS(50), ScalePS(60)) text:@"正在招聘的职位" textColor:THEMECOLOR_OF_TEXT_666666 font:Font_16];
    [bottomBgView addSubview:bottomLbl];
    UIImageView *bottomImgView = [UIToolsControl initImageViewWithFrame:CGRectMake(WIDTH*0.5-ScalePS(10), ScalePS(15), ScalePS(20), ScalePS(10)) imageName:@"detail_down_icon"];
    [bottomBgView addSubview:bottomImgView];
    UIButton *bottomBtn = [UIToolsControl initButtonWithFrame:CGRectMake(0, 0, WIDTH, ScalePS(70)) imageName:nil target:self action:@selector(bottomBtnTap:) title:nil titleColor:nil];
    bottomBtn.selected = NO;
    [bottomBgView addSubview:bottomBtn];
    
    self.jobTableView = [UIToolsControl initTableViewWithFrame:CGRectMake(0, EndY(bottomLbl), WIDTH, ViewHeight(bottomBgView)-ScalePS(70)) target:self style:UITableViewStylePlain];
//    jobTableView.separatorInset = UIEdgeInsetsMake(0, 15*Scale, 0, 15*Scale);
    self.jobTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.jobTableView.rowHeight = ScalePS(85);
    self.jobTableView.tableFooterView = [[UIView alloc] init];
    self.jobTableView.backgroundColor = THEMECOLOR_OF_WHITE;
    [bottomBgView addSubview:self.jobTableView];
    
//    jobTableView.showsVerticalScrollIndicator = NO;
    __weak typeof(self) weakSelf = self;
    self.jobTableView.mj_footer = [MJRefreshAutoFooter footerWithRefreshingBlock:^{
        self->currentPage++;
        SVPHUDShow;
        [weakSelf.jobTableView.mj_footer beginRefreshing];
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(MJDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [weakSelf loadDataJobs];
        });
    }];
    
    showImgView = [[ShowImgView alloc] initWithTarget:self];
    showImgView.hidden = YES;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    if (itemDataArray && itemDataArray.count) {
        return itemDataArray.count;
    }
    return 0;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    CompanyOfJobCell *cell = [tableView dequeueReusableCellWithIdentifier:isCellID];
    if (!cell) {
        cell = [[CompanyOfJobCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:isCellID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    CompanyJobModel *model = itemDataArray[indexPath.row];
    [cell reloadDataModel:model];
    
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    CompanyJobModel *model = itemDataArray[indexPath.row];
    JobDetailViewController *JDVC = [[JobDetailViewController alloc] init];
    JDVC.id = model.id;
    JDVC.showSettingFlag = NO;
    [self.navigationController pushViewController:JDVC animated:YES];
}
//- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
//    return headerView;
//}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
//    return moreInfoTapFlag?infoModel.allHeight:infoModel.partHeight;
    return 0.000001;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 0.000001;
}
- (void)companyDetailBaseInfoViewMoreTap {
    moreInfoTapFlag = YES;
//    [jobTableView reloadData];
    [headerView showAllDescription];
    bottomScrollView.contentSize = CGSizeMake(0, MAX(HEIGHT-SIMEmojKeyBoardkBottomNOSafeArea_Height-ScalePS(60)+1, moreInfoTapFlag?infoModel.allHeight:infoModel.partHeight));
}
- (void)bottomBtnTap:(UIButton *)button {
    button.selected = !button.selected;
    
    [button setImage:[UIImage imageNamed:(button.selected?@"":@"")] forState:UIControlStateNormal];
    [UIView animateWithDuration:0.2 animations:^{
        self->bottomBgView.frame = CGRectMake(0, (button.selected?ScalePS(150)+SIMEmojKeyBoardkBottomNOSafeArea_Height:HEIGHT-SIMEmojKeyBoardkBottomNOSafeArea_Height-ScalePS(50)), WIDTH, HEIGHT-SIMEmojKeyBoardkBottomNOSafeArea_Height-ScalePS(200));
    }];
}
- (void)collectTap {
    self.noDataView.hidden = YES;
    if (Signin) {
        NSLog(@"collectTap");
        NSString *url = PersonFocusCompany_URL;
        if ([infoModel.focus_status integerValue]) { // 已关注
            url = PersonCancelFocusCompany_URL;
        } else { // 未关注
            url = PersonFocusCompany_URL;
        }
        NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithCapacity:0];
        dic = [UIToolsControl getPublicParameter];
        [dic setObject:self.id forKey:@"company_id"];
        
        [BaseNetManager requestWithMethod:POST path:url params:dic successBlock:^(NSDictionary * _Nonnull responseObject) {
            if ([responseObject[@"code"] integerValue] == 2000) {
                SVPHUDSuccess(responseObject[@"msg"]);
                if ([self->infoModel.focus_status integerValue]) {
                    self->infoModel.focus_status = @"0";
                } else {
                    self->infoModel.focus_status = @"1";
                }
//                self->collect = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:(([self->infoModel.focus_status integerValue])?@"collect_icon_s":@"collect_icon")] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(collectTap)];
//            self.navigationItem.rightBarButtonItems = @[self->chat, self->collect];
//                self.navigationItem.rightBarButtonItem = self->collect;
                [self->attentionBtn setTitle:(([self->infoModel.focus_status integerValue])?AttentionDoneText:AttentionText) forState:UIControlStateNormal];
                [self->attentionBtn setTitleColor:(([self->infoModel.focus_status integerValue])?THEMECOLOR_OF_ORANGE:COLOR_OF_WHITE) forState:UIControlStateNormal];
            } else {
                SVPHUDError(responseObject[@"msg"]);
            }
        } failurBlock:^(NSError * _Nonnull error) {
            SVPHUDError(NetErrorAlertText);
            [self.noDataView vcNilStatusType:VCNilStatusTypeOfNoNet superView:self.view];
        }];
    } else {
        [UIToolsControl presentSignin:self callBack:^(BOOL signinFlag) {
            
        }];
    }
}
- (void)chatTap {
    NSLog(@"chatTap");
    
    /*
    if (Signin) {
        TConversationCellData *data = [[TConversationCellData alloc] init];
        data.convId = infoModel.hrInfoModel.name;
        data.convType = TConv_Type_C2C;
        data.title = infoModel.hrInfoModel.name;
        ChatViewController *chat = [[ChatViewController alloc] init];
        chat.conversation = data;
        chat.target_uid = self.infoModel.hrInfoModel.userid;
        [self.navigationController pushViewController:chat animated:YES];
    } else {
        __weak __typeof(self)weakSelf = self;
        [UIToolsControl presentSignin:self callBack:^(BOOL signinFlag) {
            __strong __typeof(weakSelf)strongSelf = weakSelf;
            TConversationCellData *data = [[TConversationCellData alloc] init];
            data.convId = strongSelf.infoModel.hrInfoModel.name;
            data.convType = TConv_Type_C2C;
            data.title = strongSelf.infoModel.hrInfoModel.name;
            ChatViewController *chat = [[ChatViewController alloc] init];
            chat.conversation = data;
            chat.target_uid = strongSelf.infoModel.hrInfoModel.userid;
            [strongSelf.navigationController pushViewController:chat animated:YES];
        }];
    }
    */
    
    
    //    [self dismissViewControllerAnimated:NO completion:nil];
    //    [((UITabBarController *)self.presentingViewController).selectedViewController pushViewController:chat animated:YES];
}
- (void)customBackButtonTap {
    [self.navigationController popViewControllerAnimated:YES];
}

@end









/*
#import "CompanyDetailViewController.h"
#import "CompanyOfJobCell.h"
#import "CompanyDetailBaseInfoView.h"
#import "CompanyInfoModel.h"
#import "CompanyJobModel.h"
#import "JobDetailViewController.h"
#import "ShowImgView.h"
#import "ChatViewController.h"

@class TConversationCellData;

@interface CompanyDetailViewController ()<UITableViewDelegate, UITableViewDataSource, CompanyDetailBaseInfoViewDelegate, ShowImgViewDelegate>
{
    BaseNetManager *netManager;
    CompanyInfoModel *infoModel;
    
    NSMutableArray *itemDataArray;
    
    UITableView *jobTableView;
    CompanyDetailBaseInfoView *headerView;
    UIBarButtonItem *collect;
    UIBarButtonItem *chat;
    
    BOOL moreInfoTapFlag;
    ShowImgView *showImgView;
}
@end

@implementation CompanyDetailViewController

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"公司详情";
    
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(lookImg:) name:NotificationFor_CertPic_LookImg object:nil];
    
    netManager = [BaseNetManager sharedManager];
    moreInfoTapFlag = NO;
    itemDataArray = [NSMutableArray arrayWithCapacity:0];
    
    [self loadData];
//    [self initUI];
}
- (void)lookImg:(NSNotification *)notification {
    showImgView.hidden = NO;
    [showImgView reloadDataForImg:notification.userInfo[@"url"]];
}
- (void)showImgViewCancel:(ShowImgView *)shareView {
    shareView.hidden = YES;
}
- (void)loadData {
    SVPHUDShow;
    NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithCapacity:0];
    dic = [UIToolsControl getPublicParameter];
    [dic setObject:self.id forKey:@"id"];
    
    [BaseNetManager requestWithMethod:POST path:CompanyDetail_URL params:dic successBlock:^(NSDictionary * _Nonnull responseObject) {
        if ([responseObject[@"code"] integerValue] == 2000) {
            id data = responseObject[@"data"];
            self->infoModel = [[CompanyInfoModel alloc] init];
            [self->infoModel setValuesForKeysWithDictionary:data];
            self->headerView = [[CompanyDetailBaseInfoView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, self->infoModel.partHeight) target:self info:self->infoModel];
            [self initUI];
            [self loadDataJobs];
        } else {
            [self.navigationController popViewControllerAnimated:YES];
            SVPHUDError(responseObject[@"msg"]);
        }
    } failurBlock:^(NSError * _Nonnull error) {
        [self loadData];
    }];
}
- (void)loadDataJobs {
    self.noDataView.hidden = YES;
    NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithCapacity:0];
    dic = [UIToolsControl getPublicParameter];
    [dic setObject:self.id forKey:@"company_id"];
    [dic setObject:@"1" forKey:@"page"];
    [dic setObject:PageSize forKey:@"number"];
    
    [BaseNetManager requestWithMethod:POST path:CompanyJobs_URL params:dic successBlock:^(NSDictionary * _Nonnull responseObject) {
        if ([responseObject[@"code"] integerValue] == 2000) {
            id data = responseObject[@"data"];
            for (NSDictionary *dic in data) {
                CompanyJobModel *model = [[CompanyJobModel alloc] init];
                [model setValuesForKeysWithDictionary:dic];
                [self->itemDataArray addObject:model];
            }
            [self->jobTableView reloadData];
            SVPHUDDismiss;
        } else {
            SVPHUDError(responseObject[@"msg"]);
        }
    } failurBlock:^(NSError * _Nonnull error) {
        SVPHUDError(NetErrorAlertText);
        [self.noDataView vcNilStatusType:VCNilStatusTypeOfNoNet superView:self.view];
    }];
}
//PersonFocusCompany_URL
- (void)initUI {
    self.view.backgroundColor = THEMECOLOR_OF_WHITE;
    collect = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:(([infoModel.focus_status integerValue])?@"collect_icon_s":@"collect_icon")] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(collectTap)];
//    chat = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"chat_icon"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(chatTap)];
//    self.navigationItem.rightBarButtonItems = @[chat, collect];
    self.navigationItem.rightBarButtonItem = collect;
    
    jobTableView = [UIToolsControl initTableViewWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT-HeightOfStatusBarAndNavigationBar-HeightOfTabBarSafeMargin) target:self style:UITableViewStyleGrouped];
//    jobTableView.separatorInset = UIEdgeInsetsMake(0, 15*Scale, 0, 15*Scale);
    jobTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    jobTableView.rowHeight = ScalePS(85);
    jobTableView.tableFooterView = [[UIView alloc] init];
    jobTableView.backgroundColor = COLOR_OF_CLEAR;
    [self.view addSubview:jobTableView];
    jobTableView.showsVerticalScrollIndicator = NO;
    
    showImgView = [[ShowImgView alloc] initWithTarget:self];
    showImgView.hidden = YES;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    if (itemDataArray && itemDataArray.count) {
        return itemDataArray.count;
    }
    return 0;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    CompanyOfJobCell *cell = [tableView dequeueReusableCellWithIdentifier:isCellID];
    if (!cell) {
        cell = [[CompanyOfJobCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:isCellID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    CompanyJobModel *model = itemDataArray[indexPath.row];
    [cell reloadDataModel:model];
    
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    CompanyJobModel *model = itemDataArray[indexPath.row];
    JobDetailViewController *JDVC = [[JobDetailViewController alloc] init];
    JDVC.id = model.id;
    JDVC.showSettingFlag = NO;
    [self.navigationController pushViewController:JDVC animated:YES];
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    return headerView;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return moreInfoTapFlag?infoModel.allHeight:infoModel.partHeight;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 0.00001;
}
- (void)companyDetailBaseInfoViewMoreTap {
    moreInfoTapFlag = YES;
    [jobTableView reloadData];
    [headerView showAllDescription];
}
- (void)collectTap {
    self.noDataView.hidden = YES;
    if (Signin) {
        NSLog(@"collectTap");
        NSString *url = PersonFocusCompany_URL;
        if ([infoModel.focus_status integerValue]) { // 已关注
            url = PersonCancelFocusCompany_URL;
        } else { // 未关注
            url = PersonFocusCompany_URL;
        }
        NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithCapacity:0];
        dic = [UIToolsControl getPublicParameter];
        [dic setObject:self.id forKey:@"company_id"];
        
        [BaseNetManager requestWithMethod:POST path:url params:dic successBlock:^(NSDictionary * _Nonnull responseObject) {
            if ([responseObject[@"code"] integerValue] == 2000) {
                SVPHUDSuccess(responseObject[@"msg"]);
                if ([self->infoModel.focus_status integerValue]) {
                    self->infoModel.focus_status = @"0";
                } else {
                    self->infoModel.focus_status = @"1";
                }
                self->collect = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:(([self->infoModel.focus_status integerValue])?@"collect_icon_s":@"collect_icon")] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(collectTap)];
                //            self.navigationItem.rightBarButtonItems = @[self->chat, self->collect];
                self.navigationItem.rightBarButtonItem = self->collect;
            } else {
                SVPHUDError(responseObject[@"msg"]);
            }
        } failurBlock:^(NSError * _Nonnull error) {
            SVPHUDError(NetErrorAlertText);
            [self.noDataView vcNilStatusType:VCNilStatusTypeOfNoNet superView:self.view];
        }];
    } else {
        [UIToolsControl presentSignin:self callBack:^(BOOL signinFlag) {
            
        }];
    }
}
- (void)chatTap {
    NSLog(@"chatTap");
    
//    if (Signin) {
//        TConversationCellData *data = [[TConversationCellData alloc] init];
//        data.convId = infoModel.hrInfoModel.name;
//        data.convType = TConv_Type_C2C;
//        data.title = infoModel.hrInfoModel.name;
//        ChatViewController *chat = [[ChatViewController alloc] init];
//        chat.conversation = data;
//        chat.target_uid = self.infoModel.hrInfoModel.userid;
//        [self.navigationController pushViewController:chat animated:YES];
//    } else {
//        __weak __typeof(self)weakSelf = self;
//        [UIToolsControl presentSignin:self callBack:^(BOOL signinFlag) {
//            __strong __typeof(weakSelf)strongSelf = weakSelf;
//            TConversationCellData *data = [[TConversationCellData alloc] init];
//            data.convId = strongSelf.infoModel.hrInfoModel.name;
//            data.convType = TConv_Type_C2C;
//            data.title = strongSelf.infoModel.hrInfoModel.name;
//            ChatViewController *chat = [[ChatViewController alloc] init];
//            chat.conversation = data;
//            chat.target_uid = strongSelf.infoModel.hrInfoModel.userid;
//            [strongSelf.navigationController pushViewController:chat animated:YES];
//        }];
//    }
    
    
    //    [self dismissViewControllerAnimated:NO completion:nil];
    //    [((UITabBarController *)self.presentingViewController).selectedViewController pushViewController:chat animated:YES];
}
@end
*/
